package br.com.datatraffic.restricao.domain.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Entity @Data @EqualsAndHashCode(exclude = { "programacao", "equipamentoFaixa" }) @ToString(exclude = { "programacao", "equipamentoFaixa" }) public class RestricaoAtributo {
	@Id @SequenceGenerator(name = "RESTRICAOATRIBUTO_SEQ", sequenceName = "RESTRICAOATRIBUTO_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "RESTRICAOATRIBUTO_SEQ") @Column(name = "RESTRICAO_ATRIBUTO_ID", nullable = false) private Long id;
	private String placa;
	private Float valorInicial;
	private Float valorFinal;

	@ManyToOne @JoinColumn(name = "programacao_id") private Programacao programacao;

	@ManyToOne @JoinColumn(name = "classificacao_id") private Classificacao classificacao;

	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }) @JoinColumn(name = "veiculo_id") private Veiculo veiculo;

	@ManyToOne @JoinColumn(name = "equipamento_faixa_id") private EquipamentoFaixa equipamentoFaixa;

}
